/*
 * Threads.cpp
 *
 *  Created on: 04.12.2012
 *      Author: Michael
 */

#include "rodos.h"

#include "global.h"

#include "../hardware.h"
#include "../Interfaces/I2C.h"
#include "../Kalman/Kalman.h"

#include "TTC.h"
#include "MainThread.h"
#include "Calibrate.h"
#include "InitCamera.h"

#include "../PIDController/AnglePID.h"
#include "../PIDController/VelocityPID.h"

#include "../SMControl/AngleSMC.h"
#include "../SMControl/VelocitySMC.h"

/* STM32-F4 Discovery:
   Bluetooth - Rx:PD6  Tx:PD5
   Xprintf - Rx:PD9  Tx:PD8
*/

LED leds;
UserButton button;
// Systemstate for Telemetry stuff
Systemstate state;


I2C sccb(I2C_ID1);
I2C i2c(I2C_ID2);

Magnetometer mag(&i2c);
Gyroscope gyro(&i2c, dps2000);

Kalman kalman;

AnglePID anglePID;
VelocityPID velPID;

AngleSMC angleSMC;
VelocitySMC velSMC;

PowerDriver motor;

Camera cam;
ADConverter adc;
InitCamera init("InitCam", 125);

Calibrate cal("Calibration", 150);
TTC com("TTC", 50);
MainThread thread("MainThread", 100);


